import request from "@/utils/request";

// 查询博客说说列表
export function listTalk(query) {
  return request({
    url: "/blog/talk/list",
    method: "get",
    params: query,
  });
}

// 查询博客说说详细
export function getTalk(talkId) {
  return request({
    url: "/blog/talk/" + talkId,
    method: "get",
  });
}

// 新增博客说说
export function addTalk(data) {
  return request({
    url: "/blog/talk",
    method: "post",
    data: data,
  });
}

// 修改博客说说
export function updateTalk(data) {
  return request({
    url: "/blog/talk",
    method: "put",
    data: data,
  });
}

// 删除博客说说
export function delTalk(talkId) {
  return request({
    url: "/blog/talk/" + talkId,
    method: "delete",
  });
}
// 修改说说状态
export function changeTalkStatus(talkId, status) {
  const data = {
    talkId,
    status,
  };
  return request({
    url: "/blog/talk/changeStatus",
    method: "put",
    data: data,
  });
}
// 修改说说置顶
export function changeTalkIsTop(talkId, isTop) {
  const data = {
    talkId,
    isTop,
  };
  return request({
    url: "/blog/talk/changeIsTop",
    method: "put",
    data: data,
  });
}
